package com.rui.cn.feignservice;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.rui.cn.consumer.common.FeignClientConfig;
import com.rui.cn.entity.system.SysMenu;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 菜单 服务类
 * </p>
 *
 * @author zhang123
 * @since 2018-01-14
 */
@FeignClient(value="CLOUD-ZUUL-GATEWAY",configuration=FeignClientConfig.class)
public interface SysMenuService{

    @GetMapping(value = "/cloud/permission-proxy/sysmenu/menuList/{id}")
    List<SysMenu> menuList(@PathVariable("id") Integer id);

    @GetMapping(value = "/cloud/permission-proxy/sysmenu/getMenuInfo/{id}")
    SysMenu getMenuInfo(@PathVariable("id") Integer id);

    @GetMapping(value = "/cloud/permission-proxy/sysmenu/getRoleMenu/{roleid}")
    List<SysMenu> getRoleMenu(@PathVariable("roleid") Integer roleid);

    @PostMapping(value = "/cloud/permission-proxy/sysmenu/selectList")
    List<SysMenu> selectList();

    @PostMapping(value = "/cloud/permission-proxy/sysmenu/insertOrUpdate")
    boolean insertOrUpdate(@RequestBody SysMenu sysMenu);

    @DeleteMapping(value ="/cloud/permission-proxy/sysmenu/deleteById/{id}" )
    void deleteById(@PathVariable("id") Integer id);

    @GetMapping(value = "/cloud/permission-proxy/sysmenu/selectById/{id}")
    SysMenu selectById(@PathVariable("id") Integer id);

    @GetMapping(value = "/cloud/permission-proxy/sysmenu/selectListByparentId/{parentid}")
    List<SysMenu> selectListByparentId(@PathVariable("parentid") Integer parentid);

    @GetMapping(value = "/cloud/permission-proxy/sysmenu/selectByparentOrid/{id}")
    List<SysMenu> selectListByparentIdOrId(@PathVariable(required = false,value = "id") String id);
}
